<template>
	<view>
		<view class="majorCon">
			<view>
				<input class="userinfoCla" type="password" v-model="onePass" placeholder="请设置密码"/>
			</view>
			<view class="BelowCla">
				<input type="password" v-model="twoPass" class="userinfoCla" placeholder="请再输入一次"/>
			</view>
			<view>
				<button type="primary" style="width: 600rpx;background: #FF7300;" @tap="setUpFun">设置完成</button>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				onePass: "",
				twoPass: "",
				telephone: ""
			}
		},
		
		methods: {
			setUpFun() {
				if(this.onePass === "" || this.twoPass === "" || this.onePass !== this.twoPass){
					uni.showToast({
						title: "请检查密码"
					})
				}else {
					this.$myRequest({
						url: "/user/update",
						methed: "post",
						header: {
							'content-type' : 'application/json'
						},
						data: {
							login_name: this.telephone,
							login_pass: Number(this.onePass) ,
							is_teach_paypal: true
						}
					}).then((res) => {
						if(res.code == 0) {
							uni.navigateTo({
								url: '/pages/tabBer/newsshouye/newsshouye' 
							})
						}
					})
				}
			}
		},
		
		onLoad() {
			try {
				this.telephone = uni.getStorageSync('userif_list').mobile
			}catch(e){}
		}
	}
</script>
<style lang="scss" scoped>
	.majorCon {
		display: flex;
		flex-direction: column;
		align-items: center;
		.BelowCla {
			position: relative;
			.bntCla {
				width: 200rpx;
				height: 80rpx;
				background: #FF7300;
				position: absolute;
				top: 40rpx;
				left: 400rpx;
				font-size: 20rpx;
				box-sizing: border-box;
				line-height: 80rpx;
				z-index: 1212;
			}
		}
		.userinfoCla {
			height: 80rpx;
			width: 600rpx;
			border: 1rpx solid #FF7300;
			margin: 40rpx 0;
			box-sizing: border-box;
			padding: 0 40rpx;
			font-size: 28rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
		}
	}
</style>